package main

import "fmt"
import "strconv"

func main() {
	var str1 string = "123"
	var str string = "hello"
	var number int64
	number, _ = strconv.ParseInt(str1, 10, 64)
	fmt.Printf("number type is %T, number = %v\n", number, number)

	// 如果没有转成功，则字符串->int这个值变为0
	number, _= strconv.ParseInt(str, 10, 64)
	fmt.Printf("number type is %T, number = %v\n", number, number)

	// 如果是布尔值没转成功，就会变成false
	var isMarry bool
	isMarry, _ = strconv.ParseBool(str)
	fmt.Printf("isMarry type is %T, isMarry = %v\n", isMarry, isMarry)
}